package org.trademarket.trader.domain;

import org.springframework.util.Assert;

public class Proposal {
	private Trader trader;
	private Trade trade;
	private TradeType operation;

	public Proposal(Trader trader) {
		Assert.notNull(trader, "Trader cannot be null");
		this.trader = trader;
		this.trade = trader.getTradeToPropose();
		this.operation = trader.getTradeType();
	}

	public Trade getTrade() {
		return trade;
	}

	public Trader getTrader() {
		return trader;
	}

	public TradeType getOperation() {
		return operation;
	}
	
	@Override
	public String toString() {
		return "Proposal from trader "+ trader.getName() +" [operation=" + operation + ": " +  trade + "]";
	}

}
